package com.lottery.bootdo.common.controller.system;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * @author furutaka
 */
@Controller
@RequestMapping("/collective")
@Slf4j
@Api(value = "/collective",tags="公共跳转页")
public class CommonController {
	private String template="/pages/URL.html";

	@ApiOperation(value = "公共跳转页")
	@RequestMapping(value = "/toLogin", method = RequestMethod.GET)
	public String toLogin(HttpServletRequest request,Model model){
		log.info("login");
		model.addAttribute("ctxPath","/");
		return  template.replaceAll("URL","login");
	}

	@ApiOperation(value = "公共跳转页")
	@RequestMapping(value = "/{url}", method = RequestMethod.GET)
	public String skip(@PathVariable String url){
		log.info("login");
		return  template.replaceAll("URL",url);
	}
}
